package cn.escco.ocr.dto.vo;

import java.io.Serializable;

import cn.escco.ocr.enums.ErrorCode;
import lombok.Data;
import lombok.ToString;

/**
 * <p>
 * Response Vo
 * </p>
 *
 * @author 
 * @since 
 */
@Data
@ToString
public class RespVo<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -3274504990220281379L;

    /**
     * 消息
     */
    private String msg;

    /**
     * 状态编码
     */
    private String code;

    /**
     * 结果集
     */
    private T result;

    public RespVo(ErrorCode errorCode) {
        this.msg = errorCode.getMsg();
        this.code = errorCode.getCode();
    }

    public RespVo() {

    }

    public RespVo(T result) {
        this.msg = ErrorCode.SUCCESSFUL.getMsg();
        this.code = ErrorCode.SUCCESSFUL.getCode();
        this.result = result;
    }
}
